﻿@using BonjourQuotation.UI.Models.OptionalModel
@model ManageOptionalsGridViewModel
@{

}
@using (@Html.BeginForm("SaveOptionalGridData", "Optional", FormMethod.Post, new { id = "LoadOptionalGridForm" }))
{
    @Html.HiddenFor(model => model.TopScrollPossition)
    <div style="width:1021px; min-height:300px; max-height:442px; margin:auto; padding-top:30px; padding-bottom:30px; ">
        <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 1000px;background-color:white;">
            <thead>
                <tr>
                    <th width="41%;" class="GridHeaders">Vendor Name</th>
                    <th width="15%;" class="GridHeaders">City</th>
                    <th width="15%;" class="GridHeaders">Start Date</th>
                    <th width="15%;" class="GridHeaders">End Date</th>
                    <th width="7%;" class="GridHeaders">Active</th>
                    <th width="7%;" class="GridHeaders">Details</th>
                </tr>
            </thead>
        </table>
        <div id="OptionalGridDetailDiv" style="height:350px; overflow-y:auto;">
            <table class="table table-bordered table-hover table-condensed" style="width: 1000px; table-layout: fixed; background-color: white;">
                <tbody>
                    @for (int ind = 0; ind < Model.Rows.Count; ind++)
                    {
                        @Html.HiddenFor(model => model.Rows[ind].OptionalID)
                        <tr>
                            <td width="41%;">@Html.LabelForModel(Model.Rows[ind].VendorName, new { @class = "table_inputs_400", @style = "text-align: left" })</td>
                            <td width="15%;">@Html.LabelForModel(Model.Rows[ind].City, new { @class = "table_inputs_140", @style = "text-align: left" })</td>
                            <td width="15%;">@Html.LabelForModel(Model.Rows[ind].ContractStartDate, new { @class = "table_inputs_140", @style = "text-align: left" })</td>
                            <td width="15%;">@Html.LabelForModel(Model.Rows[ind].ContractEndDate, new { @class = "table_inputs_140", @style = "text-align: left" })</td>
                            @if (Model.MenuManageOptionalEdit)
                            {
                                <td width="7%;" style="text-align:center">@Html.CheckBoxFor(model => model.Rows[ind].IsActive, new { @class = "ChangedOptionalGridElements" })</td>
                            }
                            else
                            {
                                <td width="7%;">@Html.LabelForModel(Model.Rows[ind].IsActive ? "Yes" : "No", new { @class = "table_inputs_65", @style = "text-align: left" })</td>
                            }
                            <td width="7%;" style="text-align:center"><button class="btn14 btn60 btnheight22" type="button" onclick="ShowOptional('@Model.Rows[ind].OptionalID')">Details</button></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}

<div style="float: right; height: 25px; width: 140px; margin-right: 95px; ">
    <button class="btn14 btn60" style="float: left;@(@Model.IsCanView ? "" : "Display:none ")" type="button" id="OptionalMoreBtn">More</button>
    @if (Model.MenuManageOptionalEdit)
    {
    <button class="btn14 btn50" style="float: right;" type="button" id="OptionalGridSaveBtn">Save</button>
    }
    else
    {
        <button class="btn14 btn50" style="float: right;" type="button" disabled="disabled" id="OptionalGridSaveBtn">Save</button>
    }
</div>